<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然企业级管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <div class="row h-home-path">
          <div class="col-md-12">
            <ol class="breadcrumb">
              <li><i class="fa fa-home"></i>&nbsp;&nbsp;所在位置</li>
              <li>首页</li>
              <li class="active">流程文件部署</li>
            </ol>
          </div>
        </div>
        <div class="form-horizontal  h-form-warp">
          <div class="h-msg-title h-table-header">
            <strong>流程文件部署</strong>
          </div>
          <form action="/act/process/deploy" class="form-horizontal" enctype="multipart/form-data"
                id="processDeployForm" method="post"
                role="form">
            <div class="form-group">
              <@PageDict dict_name="category" dict_desc="流程分类" dict_key="act_category"
              dict_value="" dict_type="select"
              label_class="col-sm-2 control-label text-right" dict_class="col-sm-8" required="required" />
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">流程文件 ：</label>
              <div class="col-sm-8">
                <input class=" required" id="file" name="file" type="file"/>
                <span class="help-inline">支持文件格式：zip、bar、bpmn、bpmn20.xml</span>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label"> </label>
              <div class="col-sm-8">
                <@permission btnId="saveBtn" btnValue="执行部署" op="flow:publish:add"
                btnMethod="ActReProcdefMgr.submitForm()"/>
                <button class="btn btn-info" id="return-btn" onclick="returnIndex()"><i class="fa fa-mail-reply">&nbsp;&nbsp;</i>返回
                </button>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
    <!-- end: PAGE -->
  </div>
  <!-- end: MAIN CONTAINER -->
</div>

<#include "/common/jslib.html">
<!-- 弹窗下拉 -->
<script type="text/javascript">
    function returnIndex() {
        window.location.href = "/actReProcdef/query";
    }

    $(function () {
        // 页面操作类型：add(添加)-edit(编辑)-view(查看)
        var operation = $("#operation").val();
        // 弹出窗体控制
        ActReProcdefMgr = {
            // 初始化
            init: function () {
                // 查看的时候不显示保存按钮
                if (operation == "view") {
                    Jmts.setFormReadOnly();
                }
            },
            // init end

            // 提交数据
            submitForm: function () {
                var options = {
                    success: ActReProcdefMgr.callBackSuccess,
                    error: ActReProcdefMgr.callBackError
                }
                showloading();
                Jmts.submitForm($("#processDeployForm"), options);
                return false;
            },
            // submitForm end
            returnIndex: function () {
                window.location.href = "/actReProcdef/query";
            },
            callBackSuccess: function (data) {
                closeloading();
                Jmts.succTips("导入成功");
            },
            callBackError: function (data) {
                closeloading();
                Jmts.errorTips("导入失败:" + data.msg);
            }
        };
        // 执行初始化
        ActReProcdefMgr.init();
        // 前台验证表单
        $("#actReProcdefForm").validate();
    });
</script>
</body>
</html>
